package com.ynkbny.web.controller;

import com.ynkbny.base.PageResult;
import com.ynkbny.domain.DeviceAttribute;
import com.ynkbny.domain.Enterprise;
import com.ynkbny.domain.pojo.DeviceAttributeListVO;
import com.ynkbny.domain.pojo.DeviceAttributePaginReqVO;
import com.ynkbny.domain.pojo.EnterpriseGetNameVO;
import com.ynkbny.domain.pojo.EnterprisePaginReqVO;
import com.ynkbny.service.DeviceAttributeService;
import com.ynkbny.util.Res;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 设备的属性快照 -控制层
 *
 * @author : juzipi123
 * @date : 2023-8-25
 */
@Slf4j
@Api(tags = "设备的属性快照 对应的接口")
@RestController
@RequestMapping("deviceAttribute")
public class DeviceAttributeController {

    @Resource
    private DeviceAttributeService service;
    /**
     * 分页查询
     *
     * @author : juzipi123
     * @param vo 筛选条件
     * @return 查询结果
     */
    @ApiOperation("分页查询")
    @GetMapping("/paginQuery")
    public Res<PageResult<DeviceAttribute>> paginQuery(DeviceAttributePaginReqVO vo) {
        log.info("请求参数：{}",vo);
        PageResult<DeviceAttribute> pageResult = service.paginQuery(vo);
        log.info("返回值：{}",pageResult);
        return Res.ok(pageResult);
    }

    /**
     * 查询 设备的属性快照 列表
     *
     * @Author juzipi123
     * @return list
     */
    @ApiOperation("设备的属性快照 列表")
    @GetMapping("/getList")
    public Res<List<DeviceAttribute>> getList(DeviceAttributeListVO vo) {
        log.info("请求参数：{}",vo);
        List<DeviceAttribute> deviceAttribute = service.getList(vo);
        log.info("返回值：{}",deviceAttribute);
        return Res.ok(deviceAttribute);
    }
}
